﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace Guoc.BigMall.Infrastructure.WeChat.Entitys
{
   
    public class ResponseMessageText : ResponseMessage
    {
        public ResponseMessageText() {
            this.MsgType = getTextMessage();
            this.CreateTime = ConvertDateTimelong(DateTime.Now);
        }
        public string Context { get; set; }

        public override string ToString()
        {
            StringBuilder xml = new StringBuilder();
            xml.Append("<xml>");
            xml.AppendFormat("<ToUserName><![CDATA[{0}]]></ToUserName>", this.ToUserName);
            xml.AppendFormat("<FromUserName><![CDATA[{0}]]></FromUserName>", this.FromUserName);
            xml.AppendFormat("<CreateTime>{0}</CreateTime>", this.CreateTime);
            xml.Append("<MsgType><![CDATA[text]]></MsgType>");
            xml.AppendFormat("<Content><![CDATA[{0}]]></Content>", this.Context);
            xml.Append("</xml>");

            return xml.ToString();
        }
    }
}
